<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增单选题')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-sysSingleQuestion-add">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">适用课程：</label>
                    <div class="col-sm-8">
                        <select name="courseId" class="form-control select2-multiple">
                            <option th:each="course:${sysCourses}"
                                    th:value="${course.id}"
                                    th:text="${course.courseName}">
                            </option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">题目描述：</label>
                    <div class="col-sm-8">
                        <textarea name="titleDescription" class="form-control" required></textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">选项A：</label>
                    <div class="col-sm-8">
                        <input name="optionA" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">选项B：</label>
                    <div class="col-sm-8">
                        <input name="optionB" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">选项C：</label>
                    <div class="col-sm-8">
                        <input name="optionC" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">选项D：</label>
                    <div class="col-sm-8">
                        <input name="optionD" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">正确答案：</label>
                    <div class="col-sm-8">
                        <select name="answer" class="form-control select2-multiple">
                            <option value="A">A</option>
                            <option value="B">B</option>
                            <option value="C">C</option>
                            <option value="D">D</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">分数：</label>
                    <div class="col-sm-8">
                        <input name="grade" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/sysSingleQuestion"
        $("#form-sysSingleQuestion-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-sysSingleQuestion-add').serialize());
            }
        }
    </script>
</body>
</html>